package terminal_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 终端-终端参数检查要求
type terminalCheckParam int

var TerminalCheckParam terminalCheckParam

// 必要
func (c *terminalCheckParam) Required() int {
	return 1
}

// 可选
func (c *terminalCheckParam) Optional() int {
	return 2
}

func (c *terminalCheckParam) ToText(value int) string {
	switch value {

	case 1:
		return "必要"

	case 2:
		return "可选"

	}
	return ""
}

func (c *terminalCheckParam) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *terminalCheckParam) ToValue(text string) int {
	switch text {

	case "必要":
		return 1

	case "可选":
		return 2

	}
	return 0
}
